﻿@{
    ViewBag.Title = "供应商管理";
    Layout = "~/Areas/Shared/_spList.cshtml";
    ViewBag.ListActionURL = Url.Action("SupplierList", "SupplierManage", new { area = "Hiner" });
    ViewBag.AddActionURL = Url.Action("AddSupplier", "SupplierManage", new { area = "Hiner" });
    ViewBag.DelActionURL = Url.Action("DelSupplier", "SupplierManage", new { area = "Hiner" });
    ViewBag.EditActionURL = Url.Action("EditSupplier", "SupplierManage", new { area = "Hiner" });
    ViewBag.IdColumn = "SupplierId";
    ViewBag.NameColumn = "SupplierName";
    ViewBag.ListSortName = "";
    ViewBag.ListSortOrder = "";
    ViewBag.AddWindowTitle = "添加供应商";
    ViewBag.EditWindowTitle = "编辑供应商";   
}
@model Kaiser.Modules.Hiner.Models.Supplier.SupplierBase
@section Script
{
    <script type="text/javascript">
        function ViewProduct(id) {
            stopPropagation();
            var dialog = openWindow({
                title: "供应商详细",
                url: '@Url.Action("ViewSupplier")?id=' +id,
                    height: 600,
                    width: 800,
                    isIframe: true,
                    toolbar: [
                        {
                            text: '关闭',
                            iconCls: "icon-no",
                            handler: function () {
                                dialog.dialog("close");
                            }
                        }
                    ]
              });


            }

            config.GridOption.columns = [[
                {
                    field: 'SupplierCode',
                    title: '供应商编码',
                    sortable: true,
                    formatter: function (value, row, index) {
                        var html = '<a   href="#" onclick=ViewProduct("' + row.SupplierId + '")>' + value + '</a>';
                        return html;
                    }
                },
                { field: 'SupplierTypeCode', title: '供应商代号', sortable: true },
                { field: 'SupplierName', title: '供应商中文名', sortable: true },
                {
                    field: 'SupplierLinkManName',
                    title: '供应商联系方式及联系人',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return row.SupplierLinkManName + ',' + row.SupplierContactWay;
                    }
                }
            ]];

            config.GridOption.toolbar = [{
                text: '新增',
                iconCls: 'icon-add',
                handler: add
            }, '-', {
                text: '修改',
                iconCls: 'icon-edit',
                handler: edit
            }, '-', {
                text: '删除',
                iconCls: 'icon-remove',
                handler: del
            }];


    </script>
}
<div>
    <div id="Dlg-CategoryTree" style="width: 350px; height: 220px;">
        <ul class="easyui-tree" id="SelectCategoryTree">
        </ul>
    </div>
    <div id="Dlg-Edit" title="编辑" style="width: 600px; height: 460px;" buttons="#buttons">
        <div style="padding: 5px">
            <form method="post" id="Form1">
                <table>
                    <tr>
                        <td class="itemtxt" style="text-align: right">名称：
                        </td>
                        <td>
                            @Html.HiddenFor(m => Model.SupplierId)
                            @Html.TextBoxFor(m => Model.SupplierName, new { @Class = "easyui-validatebox", @required = "true", @type = "text", @style = "width: 200px;", @maxlength = "10" })
                        </td>
                        <td style="text-align: right">编码：
                        </td>
                        <td>
                            @Html.TextBoxFor(m => Model.SupplierCode, new { @Class = "easyui-validatebox", @required = "true", @style = "width: 200px;", @maxlength = "10" })
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">联系人：
                        </td>
                        <td>
                            @Html.TextBoxFor(m => Model.SupplierLinkManName, new { @Class = "easyui-validatebox", @required = "true", @style = "width: 200px;" })
                        </td>
                        <td style="text-align: right">联系方式：
                        </td>
                        <td>
                            @Html.TextBoxFor(m => Model.SupplierContactWay, new { @Class = "easyui-validatebox", @required = "true", @style = "width: 200px;" })
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">地区：
                        </td>
                        <td colspan="3">
                            @Html.TextAreaFor(m => Model.SupplierAddress, new { @style = "width:99%;height:100px;" })
                        </td>

                    </tr>
                    <tr>
                        <td style="text-align: right">汇款信息：    
                        </td>
                        <td colspan="3">
                            @Html.TextAreaFor(m => Model.SupplierRemittance, new { @style = "width:99%;height:80px;" })
                        </td>

                    </tr>
                    <tr>
                        <td style="text-align: right">备注：
                        </td>
                        <td colspan="3">
                            @Html.TextAreaFor(m => Model.SupplierDesc, new { @style = "width:99%; height:200px" })
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">付款条款：
                        </td>
                        <td colspan="3">
                            @Html.TextAreaFor(m => Model.SupplierClause, new { @Class = "easyui-validatebox", @required = "true", @style = "width: 99%;", @maxlength = "10" })
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
    <div id="search-window" title="搜索" style="width: 550px; height: 250px; padding: 10px 20px">
        <div style="padding: 20px 20px 40px 40px;">
            <form method="post" id="Form2">
                <table>
                    <tr>
                        <td class="itemtxt" style="text-align: right">HDE Code：
                        </td>
                        <td>
                            @Html.TextBox("HDECode", "")
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">Hiner Code：
                        </td>
                        <td>
                            @Html.TextBox("HinerCode", "")
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">OE Ref：
                        </td>
                        <td>
                            @Html.TextBox("OERef.", "")
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">请选择供应商：
                        </td>
                        <td>
                            @Html.DropDownList("OERef.", new List<SelectListItem>(), new { style = "width:100px" })
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right">价格范围：
                        </td>
                        <td>
                            @Html.TextBox("MinPrice.", "", new { style = "width:30px" })到 @Html.TextBox("MaxPrice.", "", new { style = "width:30px" })
                        </td>
                    </tr>
                </table>
            </form>
        </div>
        <div style="text-align: center; padding: 5px;">
            <a href="javascript:void(0)" onclick="SearchOK()" id="btn-search" icon="icon-ok">确定</a>
            <a href="javascript:void(0)" onclick="closeSearchWindow()" id="btn-search-cancel"
                icon="icon-cancel">取消</a>
        </div>
    </div>
</div>
